package com.dhcc.bpm.common.utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName ResResult
 * @Description 返回响应数据
 * @Author sjm
 * @Date 2020/3/10 0010 20:29
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
@ApiModel(description= "返回响应数据")
public class ResResult {
    @ApiModelProperty(value = "状态码")
    private ResHead Head;

    public ResHead getHead() {
        return Head;
    }

    public void setHead(ResHead head) {
        Head = head;
    }



    private ResResult() {}

    public ResResult(ResHead head) {
        Head = head;
    }


    public static ResResult success() {
        ResResult resResult = new ResResult();
        resResult.setHead(ResHead.success());
        return resResult;
    }

    public static ResResult error(String msg) {
        ResResult resResult = new ResResult();
        resResult.setHead(ResHead.error(msg));
        return resResult;
    }
}
